/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SMeterInputConverter.java
 * Created：		2016年8月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.device.weibao.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.device.weibao.ADeviceWeibaoField;
import com.thor.palmmall.spi.device.weibao.SDeviceWeibaoField;

/**
 * @author wolv
 *
 */
public class SDeviceWeibaoFieldConverter
    implements Converter<ADeviceWeibaoField, SDeviceWeibaoField> {

  public static SDeviceWeibaoFieldConverter getInstance() {
    if (instance == null)
      instance = new SDeviceWeibaoFieldConverter();
    return instance;
  }

  private static SDeviceWeibaoFieldConverter instance;

  private SDeviceWeibaoFieldConverter() {
  }

  @Override
  public SDeviceWeibaoField convert(ADeviceWeibaoField source) {
    if (source == null)
      return null;

    SDeviceWeibaoField target = new SDeviceWeibaoField();

    target.setUuid(source.getUuid());
    target.setName(source.getName());
    target.setFieldType(source.getFieldType());
    target.setValue(source.getValue());

    return target;
  }

}
